[mirrors]
http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.5.tar.xz

[vars]
filesize=10457620
sha512=6da4bdb0a43d56c7a8e4dddbcacf237e998ebb54706c8f835b53713dbdf924e40d5f89f63017515e1d66904ca01f28058cf296567104e06540c57f036dcdd0fe
desc='interpreter for the ruby scripting language'

[deps]
zlib
libressl
gdbm

[build]
# Ruby still uses RAND_egd() (it really shouldn't!).
# Upstream report: https://bugs.ruby-lang.org/issues/10053
# Patch similar to the wget one discussed here:
# https://devsonacid.wordpress.com/2014/07/12/how-compatible-is-libressl/
patch -p1 < "$K"/ruby-libressl.patch

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir --with-baseruby=ruby"
# ruby crosscompile requires ruby installed on the host!

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure -C $xconfflags \
  stack_protector=no \
  --without-jemalloc \
  --prefix="$butch_prefix" \
  rb_cv_binary_elf=yes \
  --disable-install-doc

 # the elf test is broken, it uses cat -e which is gnu only

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
